home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / quad / Quad_PutUns.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-18  |  1.2 KB  |  50 lines

  1. /* 
  2.  * Quad_PutUns.c --
  3.  *
  4.  *    Implemenation of Quad_PutUns library routine.
  5.  *
  6.  * Copyright 1991 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that this copyright
  10.  * notice appears in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: /sprite/src/lib/c/quad/RCS/Quad_PutUns.c,v 1.1 91/03/18 12:21:00 kupfer Exp $ SPRITE (Berkeley)";
  18. #endif /* not lint */
  19.  
  20. #include <quad.h>
  21.  
  22.  
  23. /*
  24.  *----------------------------------------------------------------------
  25.  *
  26.  * Quad_PutUns --
  27.  *
  28.  *    Format the given unsigned quad and write it to the given stream.
  29.  *
  30.  * Results:
  31.  *    None.
  32.  *
  33.  * Side effects:
  34.  *    None.
  35.  *
  36.  *----------------------------------------------------------------------
  37.  */
  38.  
  39. void
  40. Quad_PutUns(stream, q)
  41.     FILE *stream;
  42.     u_quad q;
  43. {
  44.     if (q.val[QUAD_MOST_SIG] == 0) {
  45.     fprintf(stream, "%lu", q.val[QUAD_LEAST_SIG]);
  46.     } else {
  47.     fprintf(stream, "%.12g", Quad_UnsToDouble(q));
  48.     }
  49. }
  50.